home *** CD-ROM | disk | FTP | other *** search
/ Dynamic HTML Construction Kit / Dynamic HTML Construction Kit.iso / earthlink / nscomm / java40.jar / netscape / net / URLInputStream.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-11-03  |  755 b   |  35 lines

  1. package netscape.net;
  2.  
  3. import java.io.IOException;
  4. import java.io.InputStream;
  5.  
  6. public class URLInputStream extends InputStream {
  7.    protected URLConnection connection;
  8.    private byte[] temp = new byte[1];
  9.  
  10.    public URLInputStream(URLConnection var1) {
  11.       this.connection = var1;
  12.    }
  13.  
  14.    protected native void open() throws IOException;
  15.  
  16.    public int read() throws IOException {
  17.       int var1 = this.read(this.temp, 0, 1);
  18.       return var1 <= 0 ? -1 : this.temp[0] & 255;
  19.    }
  20.  
  21.    public int read(byte[] var1, int var2, int var3) throws IOException {
  22.       return this.read0(var1, var2, var3);
  23.    }
  24.  
  25.    native int read0(byte[] var1, int var2, int var3) throws IOException;
  26.  
  27.    public native long skip(long var1) throws IOException;
  28.  
  29.    public native int available() throws IOException;
  30.  
  31.    public void close() throws IOException {
  32.       this.connection.close();
  33.    }
  34. }
  35.